package com.tedu.feedPostModerationManagement.service.FeedPostModerationManagementServiceImpl;

import com.tedu.common.response.PageData;
import com.tedu.feedPostModerationManagement.mapper.FeedPostModerationManagementMapper;
import com.tedu.feedPostModerationManagement.pojo.dto.FeedPostModerationManagementQuery;
import com.tedu.feedPostModerationManagement.pojo.dto.FeedPostModerationManagementUpdate;
import com.tedu.feedPostModerationManagement.pojo.vo.FeedPostModerationManagementVO;
import com.tedu.feedPostModerationManagement.service.FeedPostModerationManagementService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class FeedPostModerationManagementServiceImpl implements FeedPostModerationManagementService {
    @Autowired
    FeedPostModerationManagementMapper mediaVariablesMapper;
    @Override
    public PageData selectAllVariables(FeedPostModerationManagementQuery feedPostModerationManagementQuery) {
        log.debug("查询的数据是:{}", feedPostModerationManagementQuery);
        List<FeedPostModerationManagementVO> feedPostModerationManagementVOList = mediaVariablesMapper.selectAllVariables(feedPostModerationManagementQuery);
        PageData dictData = new PageData();
        dictData.setList(feedPostModerationManagementVOList);
        dictData.setTotal(mediaVariablesMapper.selectVariablesCount(feedPostModerationManagementQuery));
        return dictData;
    }

    @Override
    public void isPassOrRefuse(FeedPostModerationManagementUpdate mediaVariables) {
        log.debug("修改的数据是:{}", mediaVariables);
        mediaVariablesMapper.isPassOrRefuse(mediaVariables);
    }
}
